//
//  GoodsResultCollectionViewCell.m
//  LoveHappyShopping
//
//  Created by 白水非泉 on 16/6/27.
//  Copyright © 2016年 白水非泉. All rights reserved.
//

#import "GoodsResultCollectionViewCell.h"
#import "GoodsSearchResultModel.h"
#import <UIImageView+WebCache.h>
@interface GoodsResultCollectionViewCell ()
@property (weak, nonatomic) IBOutlet UIImageView *imgView;
@property (weak, nonatomic) IBOutlet UILabel *title;
@property (weak, nonatomic) IBOutlet UILabel *priceLabel;
@property (weak, nonatomic) IBOutlet UILabel *ratePriceLabel;
@property(nonatomic,strong)UIImage *holderImg;
@end
@implementation GoodsResultCollectionViewCell
-(void)setModel:(GoodsSearchResultModel *)model{
    _model=model;
    NSURL *url=[NSURL URLWithString:model.pic_path];
    [self.imgView sd_setImageWithURL:url placeholderImage:self.holderImg];
    self.title.text=model.title;
    self.priceLabel.text=[NSString stringWithFormat:@"¥%g",model.price];
    NSString *origin=[NSString stringWithFormat:@"¥%g",model.price_with_rate];
    NSAttributedString *attrprice=[[NSAttributedString alloc]initWithString:origin attributes:@{NSStrikethroughColorAttributeName:[UIColor grayColor],NSStrikethroughStyleAttributeName:@(NSUnderlinePatternSolid | NSUnderlineStyleSingle)}];
    self.ratePriceLabel.attributedText=attrprice;
}
- (void)awakeFromNib {
    [super awakeFromNib];
    self.holderImg=[UIImage imageNamed:@"94"];
    // Initialization code
}

@end
